package cn.jljiayu.business.sys.admin.controller;

import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonInclude;
import lombok.Builder;
import lombok.Data;

import java.io.Serializable;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * 用户菜单
 *
 * @author ：zhangbaoyu
 * @date ：Created in 2020-01-14 10:35
 */
@Data
@Builder
public class RespUserMenu implements Serializable {

    private static Map<String, List<RespUserMenu>> subTreeMap = new HashMap<>();

    @JsonIgnore
    private String id;

    @JsonIgnore
    private String parentId;

    private boolean hidden;

    private String path;
    private String component;
    private String name;
    private Meta meta;

    @JsonInclude(JsonInclude.Include.NON_EMPTY)
    private List<RespUserMenu> children;

    @Data
    static
    class Meta implements Serializable {
        private String title;
        private String icon;

        public Meta() {
        }

        public Meta(String title, String icon) {
            this.title = title;
            this.icon = icon;
        }
    }
}
